package com.woniu.controller;

import com.woniu.entity.HttpStatus;
import com.woniu.entity.Result;
import com.woniu.pojo.TrainingUse;
import com.woniu.pojo.UserTraining;
import com.woniu.service.TrainingUseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/trainingUse")
@Slf4j
@Api(tags = "靶场使用")
public class TrainingUseController {

    @Autowired
    private TrainingUseService trainingUseService;

    @PostMapping("/save")
    @ApiOperation("新增")
    public Result save(@RequestBody TrainingUse trainingUse){
        boolean u = trainingUseService.save(trainingUse);
        return new Result(HttpStatus.SUCCESS,"添加成功",u);
    }
}
